using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableModuleDao:DaoBase<TableModule>
    {
        public override void AddPrimaryIndex(TableModule model)
        {
            cachePrimary[model.ID.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableModule.txt";
        }

        protected override TableModule ParseRowData(string[] rowData)
        {
            TableModule data = new TableModule();
			data.ID = rowData [0];
			data.modelName = rowData [1];
			data.desc = rowData [2];
			data.icon = rowData [3];

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.openLev = 0;
            }
            else
            {
                data.openLev = int.Parse(rowData[4]);
            }

            if (string.IsNullOrEmpty(rowData[5]))
            {
                data.showLev = 0;
            }
            else
            {
                data.showLev = int.Parse(rowData[5]);
            }

            return data;
        }



    }

}
